Skip to content

Add improved stack based GUI calculator consisting of powers, root and reciprocations#572

Open
Heisenberg-Vader wants to merge 1 commit intosouravjain540:mainfrom
Heisenberg-Vader:Stack-Calc
Open

Add improved stack based GUI calculator consisting of powers, root and reciprocations#572
Heisenberg-Vader wants to merge 1 commit intosouravjain540:mainfrom
Heisenberg-Vader:Stack-Calc

Conversation

@Heisenberg-Vader
Copy link

Add Stack-Based GUI Calculator with Powers, Roots, and Reciprocations

What it does:

  • This PR adds a GUI-based calculator using TKinter with the following features:
  • Stack-based evaluation using infix to postfix conversion (no eval() used).
  • Standard arithmetic operations: +, -, *, /, %, ^.
  • Supports square root via a^(1/2) and reciprocal (1/x) via a^(-1).
  • Handles negative numbers and parentheses correctly.
  • Simple, clickable TKinter buttons for all operations, numbers, and clear (C).

Example Usage:

  • 5^(-1) evaluates 1/5 = 0.20
  • 16^(1/2) evaluates sqrt(16) = 4.0
  • (-3+2)^2 evaluates to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant